package com.pm.system.service.impl;

import com.pm.common.utils.DateUtils;
import com.pm.system.domain.PmAppointment;
import com.pm.system.mapper.PmAppointmentMapper;
import com.pm.system.service.IPmAppointmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 预约管理Service业务层处理
 * 
 * @author li
 * @date 2025-09-22
 */
@Service
public class PmAppointmentServiceImpl implements IPmAppointmentService 
{
    @Autowired
    private PmAppointmentMapper pmAppointmentMapper;

    /**
     * 查询预约管理
     * 
     * @param id 预约管理主键
     * @return 预约管理
     */
    @Override
    public PmAppointment selectPmAppointmentById(Long id)
    {
        return pmAppointmentMapper.selectPmAppointmentById(id);
    }

    /**
     * 查询预约管理列表
     * 
     * @param pmAppointment 预约管理
     * @return 预约管理
     */
    @Override
    public List<PmAppointment> selectPmAppointmentList(PmAppointment pmAppointment)
    {
        return pmAppointmentMapper.selectPmAppointmentList(pmAppointment);
    }

    /**
     * 新增预约管理
     * 
     * @param pmAppointment 预约管理
     * @return 结果
     */
    @Override
    public int insertPmAppointment(PmAppointment pmAppointment)
    {
        pmAppointment.setCreateTime(DateUtils.getNowDate());
        return pmAppointmentMapper.insertPmAppointment(pmAppointment);
    }

    /**
     * 修改预约管理
     * 
     * @param pmAppointment 预约管理
     * @return 结果
     */
    @Override
    public int updatePmAppointment(PmAppointment pmAppointment)
    {
        return pmAppointmentMapper.updatePmAppointment(pmAppointment);
    }

    /**
     * 批量删除预约管理
     * 
     * @param ids 需要删除的预约管理主键
     * @return 结果
     */
    @Override
    public int deletePmAppointmentByIds(Long[] ids)
    {
        return pmAppointmentMapper.deletePmAppointmentByIds(ids);
    }

    /**
     * 删除预约管理信息
     * 
     * @param id 预约管理主键
     * @return 结果
     */
    @Override
    public int deletePmAppointmentById(Long id)
    {
        return pmAppointmentMapper.deletePmAppointmentById(id);
    }
}
